"""
@author: 江同学呀
@file: properties.py
@date: 2024/7/26 11:29
@desc: 
"""
from typing import Dict, Union

from espc.orm.model.base.base import _Base
from espc.orm.model.mapping.field.base_field.base_field import _BaseField


class Properties(_Base):
    """
    属性
    """
    def __init__(self, *args, **kwargs):
        super().__init__()
        self._properties: Dict[str, Union[_BaseField, Dict]] = kwargs
        return

    def _build(self) -> Dict:
        return {k: v if isinstance(v, Dict) else v._build() for k, v in self._properties.items()}


